<?php
error_reporting(0);
$isadmin=1;
include '../../comm/config.php';
include '../check.php';
include('../../comm/class_db.php');

$info=check_content($_POST['info']);
//print_r($info);exit;
$id=$info['id'];
if(!$info['renzheng']){$info['renzheng']='';}
if(!$info['end_time']){$info['end_time']="2050-01-01";}
$info['sort']=$info['sort']?$info['sort']:255;

unset($info['id']);

if($info['chanetid']==''){
    unset($info['chanetid']);
}
if($info['duomaiid']==''){
    unset($info['duomaiid']);
}
if($info['yiqifaid']==''){
    unset($info['yiqifaid']);
}

if($id=='')
{
	$info['time']=date('Y-m-d H:i:s');
    $ok=insert_one_sql("mall",$info,0);
	admin_log('新增商城');
	mysql_close();
    alert('保存成功！',-1);
}
else
{
    $ok=update_sql("mall",$info,"id=".$id,0,0);
	admin_log('更新商城');
	mysql_close();
    alert('保存成功！',-2);
}
?>